<template>
  <div class="item" :class="{ active: active }">
    <span><slot /></span>
    <div class="btns">
      <el-button text @click="$emit('edit')">
        <el-icon>
          <Edit />
        </el-icon>
      </el-button>
      <el-button text @click="$emit('close')">
        <el-icon><Close /></el-icon>
      </el-button>
    </div>
  </div>
</template>

<script setup>
defineEmits(["close", "edit"]);

defineProps({
  active: {
    type: Boolean,
    default: false,
  },
});
</script>

<style lang="less" scoped>
.item {
  width: 180px;
  background-color: rgb(207, 207, 207);
  display: flex;
  justify-content: space-between;
  height: 40px;
  align-items: center;
  border-bottom: 1px #000 solid;
  padding: 0px 5px;
  &:hover {
    background: lightblue;
  }
  span {
    font-size: 12px;
    width: 80px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    // background-color: aquamarine;
  }
}
.active {
  background: pink;
}
</style>
